Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tooltip): update default offset to match Spectrum defs #3632

Closed
wants to merge 1 commit into from

Conversation

spdev3000
Copy link
Collaborator

This PR fixes the default tooltip offset regarding to latest Spectrum defs

Description

Tooltip offset is aligned to latest Spectrum defs, see: https://spectrum.adobe.com/page/tooltip/#Offset

Related issue(s)

#3631

Motivation and context

This change aligns tooltip offset with current application and sync with latest Spectrum definitions

How has this been tested?

manual tested

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)

Checklist

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • If my change required a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices

Best practices

This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against main.

@github-actions
Copy link

github-actions bot commented Sep 8, 2023

Tachometer results

Chrome

tooltip permalink

Version Bytes Avg Time vs remote vs branch
npm latest 556 kB 99.72ms - 102.46ms - unsure 🔍
-1% - +2%
-1.45ms - +1.95ms
branch 523 kB 99.83ms - 101.84ms unsure 🔍
-2% - +1%
-1.95ms - +1.45ms
-
Firefox

tooltip permalink

Version Bytes Avg Time vs remote vs branch
npm latest 542 kB 266.73ms - 304.19ms - unsure 🔍
-2% - +14%
-4.83ms - +38.19ms
branch 558 kB 258.21ms - 279.35ms unsure 🔍
-13% - +1%
-38.19ms - +4.83ms
-

@@ -126,7 +131,7 @@ export class Tooltip extends SpectrumElement {
public selfManaged = false;

@property({ type: Number })
public offset = 0;
public offset = this.isMobile.matches ? 5 : 4;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Spectrum specs never mean "mobile" and "desktop" in this way. They mean it relative to the scale the UI is delivered in. I've reached out to the team about tokens for this before we do anything custom here. If we need to do so, we likely want this in https://github.com/adobe/spectrum-web-components/blob/main/tools/styles/scale-medium.css and https://github.com/adobe/spectrum-web-components/blob/main/tools/styles/scale-large.css

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I wasn't certain if this was referring to the scale or Mobile in general.
And yes it would make sense to check, if this can be solved by a token or spectrum-var.
Will close this for now.

@spdev3000 spdev3000 closed this Sep 8, 2023
@spdev3000 spdev3000 deleted the puchta/3631-tooltip-default-offset branch September 8, 2023 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants